package org.lc.cmd.util;

import org.lc.cmd.Cmd;

@SuppressWarnings("unused")
public class CmdInUtil {
    public static String readLine(String prompt) {
        return Cmd.INSTANCE.getBridge().readLine(prompt);
    }

    @SuppressWarnings("unused")
    public static boolean confirm(String tip) {
        while (true) {
            String s = readLine(tip + "(y/n):");
            if (s.equalsIgnoreCase("y")) {
                return true;
            }
            if (s.equalsIgnoreCase("n")) {
                return false;
            }
            CmdOutUtil.writeError("需要输入y或n ", false);
        }
    }
}
